{%extends 'template.html'%}

{%block username%}
{{head.username}}
{%endblock%}

{%block content%}
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">{{head.value}}</h1>
            <h1 class="page-header" id="workflow_id" style="display: none;">{{head.workflow}}</h1>
            <h1 class="page-header" id="wse_id" style="display: none;">{{data.id}}</h1>
            <h1 class="page-header" id="first_name" style="display: none;">{{first_name}}</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-body">
                  <div class="row">
                    <div class="col-lg-6">
                        <div class="container">
                          <form role="form" class="form-horizontal">
                            <div class="form-group">
                              <label class="col-sm-12">申请人</label>
                              <div class="col-sm-6">
                                <div class="well" id="applicant">{{data.applicant.username}}</div>
                              </div>
                            </div>
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">标题</label>
                              <div class="col-sm-6">
                                  <div class="well" id="title">{{data.title}}</div>
                              </div>
                            </div>
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">原因</label>
                              <div class="col-sm-6">
                                  <textarea class="form-control" id="reason" readonly>{{data.reason}}</textarea>
                              </div>
                            </div>
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">注意事项(可选)</label>
                              <div class="col-sm-6">
                                  <textarea class="form-control" id="attention" readonly>{{data.attention}}</textarea>
                              </div>
                            </div>
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">项目</label>
                              <div class="col-sm-6">
                                <div class="well" id="project">{{data.project}}</div>
                              </div>
                            </div>
                            <!--<div class="form-group">
                              <label class="col-sm-12" for="TextArea">指定测试负责人</label>
                              <div class="col-sm-6">
                                <select id="test_head" style="width: 100%">
                                  <option value="0" selected="selected">选择测试负责人</option>
                                </select>
                              </div>
                            </div>
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">指定运营负责人</label>
                              <div class="col-sm-6">
                                <select id="operation_head" style="width: 100%">
                                  <option value="0" selected="selected">选择运营负责人</option>
                                </select>
                              </div>
                            </div>-->
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">更新类型</label>
                              <div class="col-sm-6">
                                <div class="well" id="update_type">{{data.update_type}}</div>
                              </div>
                            </div>
                            <div class="form-group">
                              <label class="col-sm-12" for="TextArea">更新版本号</label>
                              <div class="col-sm-6">
                                <div class="well" id="update_version">{{data.update_version}}</div>
                              </div>
                            </div>
                            {% if data.update_type == '后端' %}
                              <div class="form-group update_backend">
                                  <label class="col-sm-12" for="TextArea">热更文件列表</label>
                                  <div class="col-sm-6">
                                      <textarea class="form-control" id="file_list" rows="5" readonly>{{data.file_list}}</textarea>
                                  </div>
                                </div>
                                <div class="form-group erlang_cmd">
                                  <label class="col-sm-12" for="TextArea">erlang命令</label>
                                  <div class="col-sm-6">
                                      <textarea class="form-control" id="erlang_cmd" rows="5"readonly>{{data.erlang_cmd}}</textarea>
                                  </div>
                              </div>
                            {% endif %}
                            <div class="form-group" id="update_backend_before">
                              <label class="col-sm-12" for="TextArea">更新时间</label>
                              <div class="col-sm-2">
                                  <input class="flatpickr flatpickr-input" type="text" placeholder="选择更新时间" data-time="{{data.update_time}}" id="update_time" disabled=>
                              </div>
                            </div>
                            <div class="form-group" id="choose_server_after">
                              <label class="col-sm-12" for="TextArea">添加一个选服方式</label>
                              <div class="col-sm-6">
                                <div class="well" id="choose_server">{{data.choose_server}}</div>
                              </div>
                            </div>

                             {% if data.update_type == '前端' %}
                                {% if data.choose_server == '版本号' %}
                                  <div class="form-group clean_choose_server">
                                  <label class="col-sm-12">区服列表</label>
                                  <div class="col-sm-6">
                                    <select id="server_list" multiple="multiple">
                                      {% for server_info in data.content %}
                                        <option vlaue={{server_info.srv_name}} data-section={{server_info.pf_name}} selected="selected">{{server_info.srv_name}}</option>
                                      {% endfor %}
                                    </select>
                                  </div>
                                </div>
                                {% elif data.choose_server == '前端CDN'%}
                                  {% for cdn_url_info in data.content %}
                                    {% for url, version in cdn_url_info.items %}
                                     <div class="form-group clean_choose_server">
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control cdn_url" style="width: 100%" readonly value={{url}}>
                                        </div>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control cdn_url_version" style="width: 100%" readonly value={{version}}>
                                        </div>
                                    </div>
                                    {% endfor %}
                                  {% endfor %}
                                {% endif %}
                              {% elif data.update_type == '后端' %}
                                {% if data.choose_server == '版本号' %}
                                  <div class="form-group clean_choose_server">
                                  <label class="col-sm-12">区服列表</label>
                                  <div class="col-sm-6">
                                    <select id="server_list" multiple="multiple">
                                      {% for server_info in data.content %}
                                        <option vlaue={{server_info.srv_name}} data-section={{server_info.pf_name}} selected="selected">{{server_info.srv_name}}</option>
                                      {% endfor %}
                                    </select>
                                  </div>
                                </div>
                                {% endif %}
                             {% endif %}

                            <div class="form-group" id="ystep1">
                              <label class="col-sm-12">审核流程步骤</label>
                              <div class="col-sm-6">
                                <div class="ystep1"></div>
                              </div>
                            </div>
                          </form>
                          <hr>
                        </div>
                    </div>
                  </div>
                </div>
            </div>
        </div>
    </div>
</div>
{%endblock%}
{%block bodyjs%}
    <script src="/static/js/hot_update_myworkflow.js"></script>
    <script src="/static/js/flatpickr.js"></script>
    <script src="/static/js/zh.js"></script>
    <script src="/static/js/jquery.tree-multiselect.js"></script>
    <script src="/static/js/ystep.js"></script>
{%endblock%}
{%block css%}
    <link href="/static/css/flatpickr.css" rel="stylesheet" type="text/css">
    <link href="/static/css/jquery.tree-multiselect.css" rel="stylesheet" type="text/css">
    <link href="/static/css/ystep.css" rel="stylesheet" type="text/css">
{%endblock%}
